home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / pnl010.zip / I286.PAS < prev    next >
Pascal/Delphi Source File  |  1992-03-01  |  1KB  |  49 lines

  1. {$A+,B-,D-,E-,F+,G-,I-,L-,N-,O+,R-,S-,V-,X-}
  2.  
  3. {*********************************************************}
  4. {*                     i286.pas 1.00                     *}
  5. {*            Written by: David J. N. Begley.            *}
  6. {*            Released into the public domain            *}
  7. {*********************************************************}
  8.  
  9. unit i286;
  10.   {-Intelligently exit if an Intel 80286 or higher is not detected}
  11.  
  12. interface
  13.  
  14.   {==========================================================================}
  15.  
  16. implementation
  17.  
  18. const
  19.   CConfig : String[21] = 'i286 config data 1.00';
  20.   CErrLvl : Byte       = 1;
  21.   CErrMsg : String[80] = 'An 80286 or higher processor is required.';
  22.  
  23. var
  24.   AIs286 : Boolean;
  25.  
  26. begin
  27.   asm
  28.     xor    ah, ah
  29.     pushf
  30.     pop    bx
  31.     and    bx, 00FFFh
  32.     push   bx
  33.     popf
  34.     pushf
  35.     pop    bx
  36.     and    bx, 0F000h
  37.     cmp    bx, 0F000h
  38.     je     @@1
  39.     inc    ah
  40.   @@1:
  41.     mov    [AIs286], ah
  42.   end;
  43.   if not AIs286 then
  44.     begin
  45.       WriteLn(CErrMsg);
  46.       Halt(CErrLvl)
  47.     end
  48. end.   { i286 }
  49.